const express = require("express");
const app = express();
const router = express.Router();
app.use(express.json());
app.use(router);
const db = require("../mysql/db");
router.post("/api/login", db.login);
router.get("/api/power", db.power);
router.get("/api/roleName", db.roleName);
router.post("/api/changePassword", db.changePassword);
router.post("/api/changeName", db.changeName);
router.post("/api/role", db.role);
router.get("/api/router", db.router);
router.post("/api/addRole", db.addRole);
router.post("/api/deleteRole", db.deleteRole);
router.post("/api/changeRole", db.changeRole);
router.post("/api/user", db.user);
router.get("/api/allRole", db.allRole);
router.post("/api/addUser", db.addUser);
router.post("/api/changeUser", db.changeUser);
router.post("/api/deleteUser", db.deleteUser);
router.post("/api/expenditureCategory", db.expenditureCategory);
router.post("/api/addExpenditureCategory", db.addExpenditureCategory);
router.post("/api/deleteExpenditureCategory", db.deleteExpenditureCategory);
router.post("/api/changeExpenditureCategory", db.changeExpenditureCategory);
router.post("/api/incomeCategory", db.incomeCategory);
router.post("/api/addIncomeCategory", db.addIncomeCategory);
router.post("/api/deleteIncomeCategory", db.deleteIncomeCategory);
router.post("/api/changeIncomeCategory", db.changeIncomeCategory);
router.post("/api/card", db.card);
router.post("/api/addCardNumber", db.addCardNumber);
router.post("/api/changeCardNumber", db.changeCardNumber);
router.post("/api/deleteCardNumber", db.deleteCardNumber);
router.post("/api/changeMoney", db.changeMoney);
router.get("/api/allExpenditureCategory", db.allExpenditureCategory);
router.post("/api/expenditure", db.expenditure);
router.get("/api/allCardNumber", db.allCardNumber);
router.post("/api/deleteExpenditure", db.deleteExpenditure);
router.post("/api/addExpenditure", db.addExpenditure);
router.post("/api/changeExpenditure", db.changeExpenditure);
router.get("/api/allIncomeCategory", db.allIncomeCategory);
router.post("/api/income", db.income);
router.post("/api/deleteIncome", db.deleteIncome);
router.post("/api/addIncome", db.addIncome);
router.post("/api/changeIncome", db.changeIncome);
router.get("/api/incomeSummary", db.incomeSummary);
router.get("/api/expenditureSummary", db.expenditureSummary);
router.get("/api/incomeYear", db.incomeYear);
router.get("/api/expenditureYear", db.expenditureYear);
router.get("/api/totalBalance", db.totalBalance);
router.post("/api/uploadImage", db.uploadImage);
router.post("/api/deleteImage", db.deleteImage);
router.post("/api/allCommodityCategory", db.allCommodityCategory);
router.get("/api/allCommodityCategoryAll", db.allCommodityCategoryAll);
router.post("/api/deleteCommodityCategory", db.deleteCommodityCategory);
router.post("/api/addCommodityCategory", db.addCommodityCategory);
router.post("/api/changeCommodityCategory", db.changeCommodityCategory);
router.post("/api/allCarmi", db.allCarmi);
router.post("/api/addCarmi", db.addCarmi);
router.post("/api/changeCarmi", db.changeCarmi);
router.post("/api/deleteCarmi", db.deleteCarmi);
router.post("/api/useCarmi", db.useCarmi);
router.post("/api/allCommodity", db.allCommodity);
router.post("/api/deleteCommodity", db.deleteCommodity);
router.post("/api/addCommodity", db.addCommodity);
router.post("/api/changeCommodity", db.changeCommodity);
router.post("/api/allOrder", db.allOrder);
router.get("/api/allUser", db.allUser);
router.post("/api/changeOrderState", db.changeOrderState);
router.post("/api/deleteOrder", db.deleteOrder);
router.get("/api/salesVolumeFour", db.salesVolumeFour);
router.get("/api/randomCommodity", db.randomCommodity);
router.get("/api/userInfoApi", db.userInfoApi);
router.post("/api/shoppingCommodity", db.shoppingCommodity);
router.post("/api/userOrder", db.userOrder);
router.post("/api/paymentOrder", db.paymentOrder);
module.exports = router;